<template>
  <transition name="notification-fade">
    <div v-if="show" class="notification">
      <font-awesome-icon :icon="getIcon()" />
      <span>{{ message }}</span>
    </div>
  </transition>
</template>

<script>
export default {
  name: 'Notification',
  props: {
    message: {
      type: String,
      required: true
    },
    show: {
      type: Boolean,
      default: false
    },
    type: {
      type: String,
      default: 'success'
    }
  },
  emits: ['close'],
  methods: {
    getIcon() {
      switch (this.type) {
        case 'success':
          return 'check-circle';
        case 'error':
          return 'times-circle';
        default:
          return 'info-circle';
      }
    }
  }
}
</script>

<style scoped>
.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 15px 20px;
  background-color: #10b981;
  color: white;
  border-radius: 6px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  z-index: 1000;
}

.notification.success {
  background-color: #10b981;
}

.notification.error {
  background-color: #ef4444;
}

.notification.info {
  background-color: #3b82f6;
}

.notification svg {
  margin-right: 10px;
}

.notification-fade-enter-active,
.notification-fade-leave-active {
  transition: all 0.3s ease;
}

.notification-fade-enter-from,
.notification-fade-leave-to {
  opacity: 0;
  transform: translateX(30px);
}
</style>